#ifndef SERVE_PRI_H
#define SERVE_PRI_H
#include <stdio.h>
#include <stdint.h>
#include <pthread.h>
#include <unistd.h>

#define SERVER_SOCKET "/tmp/server"
#define MQ_NAME_INT "/server_queue"
#define SOCKET_CONN_TRY 100
#define MAX_SOCK_BUF 40
#define CMD_INDEX    0
#define MSG_INDEX    5
#define TYPE_INDEX   1
#define MQ_MAX_SIZE 10

#define CMD_GET 1
#define CMD_GET_TIME 2
#define CMD_GET_MY_TIME 3
#define CMD_CNG_MY_TIME_DAY 4
#define CMD_CNG_MY_TIME_DATE 5
#define DATA_INDEX 16
#define MQ_MAX_NUM 100


typedef struct{
    int sd;
    char data[MAX_SOCK_BUF];
}MQ_Packet;

typedef struct{
    pthread_mutex_t lock;
    uint64_t clockseconds;
} TimeSeconds;

int serve_get_sock();
void mylog(char* log);
int serve_get_add_value(int a, int b, char* val);
int custm_rqst_change_my_time_day(int type, int data_number);

uint32_t getleu32(const void* ptr, int off);
void putleu32(char* data, int off, uint32_t val);
uint64_t getleu64(const void* ptr, int off);
void putleu64(char* data, int off, uint64_t val);

#endif